home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / mail / thor201.lha / THOR_2.0 / thor.lha / rexx / ZapFiles.thor < prev   
Text File  |  1995-05-15  |  1KB  |  66 lines

  1. /*
  2. ** $VER: ZapFiles.thor 0.5 (16.9.94)
  3. ** 
  4. ** ZapFiles.thor  - Script that creates sysop script commands for zapping
  5. **                  selected files in the filedatabase window.
  6. **                  Will only work on ABBS/MBBS systems.
  7. **                  Author: Petter Nilsen
  8. **
  9. */
  10.  
  11. options results
  12.  
  13. EVE_DOCOMMAND = 11
  14.  
  15. p = address()||' '||show('P',,)
  16. if(pos('THOR.',p) > 0) then 
  17.     thorport = word(substr(p,pos('THOR.',p)),1)
  18. else do
  19.     say 'No THOR port found!'
  20.     exit 10
  21. end
  22. address(thorport)
  23.  
  24. if ~show('p', 'BBSREAD') then do
  25.     address command
  26.         "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  27.         "WaitForPort BBSREAD"
  28. end
  29.  
  30. address(thorport)
  31.  
  32. CURRENTBBS stem CURRENT
  33. if(rc ~= 0) then 
  34. do
  35.     REQUESTNOTIFY TEXT '"'THOR.LASTERROR'"' BT '"_Ok"'
  36.     exit
  37. end    
  38.  
  39. bbs = CURRENT.BBSNAME
  40.  
  41. GETFILELIST outstem LIST
  42. if(rc ~= 0) then
  43. do
  44.     if(rc = 5) then REQUESTNOTIFY TEXT '"Filedatabase window not open."' BT '"_Ok"'
  45.     if(rc = 6) then REQUESTNOTIFY TEXT '"No files selected."' BT '"_Ok"'
  46.     if(rc = 30) then REQUESTNOTIFY TEXT '"'THOR.LASTERROR'"' BT '"_Ok"'
  47.     exit
  48. end
  49.  
  50. address(BBSREAD)
  51.  
  52. do i=1 to LIST.COUNT
  53.     drop EVENT.
  54.  
  55.     EVENT.COMMANDSTRING = '! zap '||LIST.FILENAME.i||' y y'
  56.  
  57.     WRITEBREVENT bbsname '"'bbs'"' event EVE_DOCOMMAND stem EVENT
  58.     if(rc ~= 0) then 
  59.     do
  60.         address(thorport)
  61.         REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
  62.         exit
  63.     end
  64. end
  65. exit
  66.